/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package jccflux;

import javax.swing.*;
import java.awt.*;
import java.io.*;
import java.util.*;
import java.awt.event.*;
import java.lang.Math;
import java.awt.FontMetrics;
import java.awt.geom.Line2D;
/**
 *
 * @author MrYoso
 */
class flowchart_panel extends JPanel
{
    LinkedList list = new LinkedList();
    public flowchart_panel()
    {

    }
    @Override 
    public void paintComponent(Graphics g)
    {
        super.paintComponent(g);
        Graphics2D g2 = (Graphics2D) g;
        
        int coordinates[] = new int[4];

        for(int i=0;i<list.size();i++)
        {
            coordinates = (int[]) list.get(i);
            
            Line2D lin = new Line2D.Float(coordinates[0],
                                          coordinates[1],
                                          coordinates[2],
                                          coordinates[3]);
            g2.draw(lin);
        }

    }
    public void addLine(int x1, int y1, int x2, int y2)
    {
        int coordinates[] = new int[4];
        coordinates[0] = x1;
        coordinates[1] = y1;
        coordinates[2] = x2;
        coordinates[3] = y2;
        list.add(coordinates);
    }
    public void clearLines()
    {
        list.clear();
    }
}  
